
def dampnm(fun,gfun,Hfun,x0,k,eps,maxk=100):
    gk= gfun(x0)
    Hk = Hfun(x0)
    dk= -Hk\gk
    
    if np.linalg.norm(gk) < eps or k >= maxk:
        return x0, fun(x0), k
    
    step = armijo(x0,dk,gk,fun，rho, sigma, tau, eps)
    return dampnm(fun,gfun,Hfun,x0+step,k+1,eps,maxk)
